package cn.wp.ewallet.wallet.service.impl;

import cn.wp.common.core.dto.WpResult;
import cn.wp.common.core.util.BeanUtil;
import cn.wp.ewallet.wallet.dao.AccountLogDao;
import cn.wp.ewallet.wallet.model.dto.AccountLogDto;
import cn.wp.ewallet.wallet.model.entity.AccountLogDo;
import cn.wp.ewallet.wallet.service.AccountLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName AccountLogServiceImpl
 * @Author ruixule
 * @Description TODO
 * @Date 2020/1/7 21:44
 */
@Service
public class AccountLogServiceImpl implements AccountLogService {

    @Autowired
    private AccountLogDao accountLogDao;

    @Override
    public AccountLogDo getAccountLogByAccountId(String accountId) {
        return  accountLogDao.selectAccountLogByAccountId(accountId);
    }

    @Override
    public void update(AccountLogDo accountLogDo) {
        accountLogDao.update(accountLogDo);
    }

    @Override
    public void saveAccountLog(AccountLogDto accountLogDto) {
        accountLogDao.insertAccountLog(BeanUtil.copyProperties(accountLogDto, AccountLogDo.class));
    }


    @Override
    public void addAccountLogDo(AccountLogDo accountLogDo) {
        accountLogDao.save(accountLogDo);

    }

}
